import 'package:flutter/material.dart';

import './carefullychosen.dart';
import './classification.dart';
import './rank.dart';
import './booklist.dart';

class TabBookStore extends StatelessWidget {
  const TabBookStore({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    List<Tab> tabItemList = [
      Tab(
        text: '精选',
      ),
      Tab(
        text: '分类',
      ),
      Tab(
        text: '榜单',
      ),
      Tab(
        text: '书单',
      )
    ];

    return DefaultTabController(
        length: tabItemList.length,
        child: Scaffold(
            appBar: AppBar(
              elevation: 0.0,
              title: Text('书城'),
              leading: Container(
                margin: EdgeInsets.only(left: 3.0),
                child: GestureDetector(
                    behavior: HitTestBehavior.translucent,
                    onTap: () {},
                    child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceAround,
                        children: [Text('男频'), Icon(Icons.arrow_downward)])),
              ),
              actions: [IconButton(onPressed: () {}, icon: Icon(Icons.search))],
              bottom: TabBar(
                tabs: tabItemList,
              ),
            ),
            body: TabBarView(
              children: [
                CarefullyChosen(),
                Classification(),
                RankList(),
                BookList(),
              ],
            )));
  }
}
